home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch6g < prev    next >
Encoding:
Text File  |  1989-11-27  |  56.7 KB  |  2,032 lines

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i060:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch6g
  5. Message-ID: <4849@tekred.CNA.TEK.COM>
  6. Date: 22 Nov 89 19:51:10 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2021
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 60
  13. Archive-name: NetHack3/Patch6g
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 7 (of 15)."
  25. # Contents:  patches06h
  26. # Wrapped by billr@saab on Wed Nov 22 10:50:13 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patches06h' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patches06h'\"
  30. else
  31. echo shar: Extracting \"'patches06h'\" \(54198 characters\)
  32. sed "s/^X//" >'patches06h' <<'END_OF_FILE'
  33. X*** src/Old/makedefs.c    Sun Nov 19 13:40:22 1989
  34. X--- src/makedefs.c    Fri Nov 17 19:31:40 1989
  35. X***************
  36. X*** 14,20 ****
  37. X  #define NULL    ((genericptr_t)0)
  38. X  
  39. X  #ifndef LINT
  40. X! static    const char    SCCS_Id[] = "@(#)makedefs.c\t3.0\t89/01/10";
  41. X  #endif
  42. X  
  43. X  #ifdef MSDOS
  44. X--- 14,20 ----
  45. X  #define NULL    ((genericptr_t)0)
  46. X  
  47. X  #ifndef LINT
  48. X! static    const char    SCCS_Id[] = "@(#)makedefs.c\t3.0\t89/11/15";
  49. X  #endif
  50. X  
  51. X  #ifdef MSDOS
  52. X***************
  53. X*** 22,28 ****
  54. X  # define freopen _freopen
  55. X  #endif
  56. X  # undef    exit
  57. X! extern void exit P((int));
  58. X  # define RDMODE    "r"
  59. X  # define WRMODE    "w"
  60. X  #else
  61. X--- 22,28 ----
  62. X  # define freopen _freopen
  63. X  #endif
  64. X  # undef    exit
  65. X! extern void FDECL(exit, (int));
  66. X  # define RDMODE    "r"
  67. X  # define WRMODE    "w"
  68. X  #else
  69. X***************
  70. X*** 83,95 ****
  71. X  
  72. X  
  73. X  char    in_line[256];
  74. X! extern char *gets P((char *));
  75. X  void do_objs(), do_traps(), do_data(), do_date(), do_permonst(), do_rumors();
  76. X  #ifdef SMALLDATA
  77. X  void do_monst(), save_resource();
  78. X  #endif
  79. X! char *limit P((char *,BOOLEAN_P));
  80. X! FILE *_freopen();
  81. X  
  82. X  int
  83. X  main(argc, argv)
  84. X--- 83,95 ----
  85. X  
  86. X  
  87. X  char    in_line[256];
  88. X! extern char *FDECL(gets, (char *));
  89. X  void do_objs(), do_traps(), do_data(), do_date(), do_permonst(), do_rumors();
  90. X  #ifdef SMALLDATA
  91. X  void do_monst(), save_resource();
  92. X  #endif
  93. X! char *FDECL(limit, (char *,BOOLEAN_P));
  94. X! FILE *FDECL(_freopen, (char *,char *,FILE *));
  95. X  
  96. X  int
  97. X  main(argc, argv)
  98. X***************
  99. X*** 211,217 ****
  100. X--- 211,221 ----
  101. X      int    ntrap;
  102. X      char    tempfile[30];
  103. X  
  104. X+ #ifdef MACOS
  105. X+     Sprintf(tempfile, ":include:makedefs.%d", getpid());
  106. X+ #else
  107. X      Sprintf(tempfile, "makedefs.%d", getpid());
  108. X+ #endif
  109. X      if(freopen(tempfile, WRMODE, stdout) == (FILE *)0) {
  110. X          perror(tempfile);
  111. X          exit(1);
  112. X***************
  113. X*** 245,251 ****
  114. X      Printf("\n#endif /* TRAP_H /**/\n");
  115. X      (void) fclose(stdin);
  116. X      (void) fclose(stdout);
  117. X! #ifdef MSDOS
  118. X      remove(TRAP_FILE);
  119. X  #endif
  120. X      rename(tempfile, TRAP_FILE);
  121. X--- 249,255 ----
  122. X      Printf("\n#endif /* TRAP_H /**/\n");
  123. X      (void) fclose(stdin);
  124. X      (void) fclose(stdout);
  125. X! #if defined(MSDOS) || defined(MACOS)
  126. X      remove(TRAP_FILE);
  127. X  #endif
  128. X      rename(tempfile, TRAP_FILE);
  129. X***************
  130. X*** 256,262 ****
  131. X  void
  132. X  do_rumors(){
  133. X      char    infile[30];
  134. X!     FILE    *freopen();
  135. X      long    true_rumor_size;
  136. X  
  137. X      if(freopen(RUMOR_FILE, WRMODE, stdout) == (FILE *)0) {
  138. X--- 260,266 ----
  139. X  void
  140. X  do_rumors(){
  141. X      char    infile[30];
  142. X!     FILE    *FDECL(freopen, (char *,char *,FILE *));
  143. X      long    true_rumor_size;
  144. X  
  145. X      if(freopen(RUMOR_FILE, WRMODE, stdout) == (FILE *)0) {
  146. X***************
  147. X*** 338,383 ****
  148. X      }
  149. X  
  150. X      while(gets(in_line) != NULL) {
  151. X! #ifdef  SINKS
  152. X!         if(!strcmp(in_line, "#\ta corridor"))
  153. X!         Printf("#\ta corridor (or a kitchen sink)\n");
  154. X!         else
  155. X  #endif
  156. X! #ifdef    ALTARS
  157. X!         if(!strcmp(in_line, "_\tan iron chain"))
  158. X!         Printf("_\tan iron chain (or an altar)\n");
  159. X          else
  160. X  #endif
  161. X! #ifdef    SPELLS
  162. X!         if(!strcmp(in_line, "+\ta door"))
  163. X!         Printf("+\ta door (or a spell book)\n");
  164. X          else
  165. X  #endif
  166. X! #ifdef    FOUNTAINS
  167. X!         if(!strcmp(in_line, "}\twater filled area")) {
  168. X!         (void) puts(in_line);
  169. X!         Printf("{\ta fountain\n");
  170. X!         } else
  171. X! #endif
  172. X! #ifdef    THRONES
  173. X!         if(!strcmp(in_line, "^\ta trap")) {
  174. X!         (void) puts(in_line);
  175. X!         Printf("\\\tan opulent throne\n");
  176. X!         } else
  177. X  #endif
  178. X-         if(!strcmp(in_line, ";\ta giant eel")) {
  179. X          (void) puts(in_line);
  180. X- #ifdef    WORM
  181. X-         Printf("~\tthe tail of a long worm\n");
  182. X- #endif
  183. X- #ifdef    GOLEMS
  184. X- Printf("'\ta golem\n");
  185. X- Printf("\t\tThese creatures, not quite living but not  really  nonliving\n");
  186. X- Printf("\t\teither,   are   created from inanimate materials by powerful\n");
  187. X- Printf("\t\tmages or priests.\n");
  188. X- #endif
  189. X-         } else
  190. X-           (void) puts(in_line);
  191. X      }
  192. X      (void) fclose(stdin);
  193. X      (void) fclose(stdout);
  194. X--- 342,368 ----
  195. X      }
  196. X  
  197. X      while(gets(in_line) != NULL) {
  198. X! #ifndef GOLEMS
  199. X!         if(!strcmp(in_line, "'\ta golem;"))
  200. X!         while(gets(in_line) != NULL && in_line[0] == '\t')
  201. X!             ; /* do nothing */
  202. X  #endif
  203. X! #ifndef    SPELLS
  204. X!         if(!strcmp(in_line, "+\ta spell book"))
  205. X!         ; /* do nothing */
  206. X          else
  207. X  #endif
  208. X! #ifndef KOPS
  209. X!         if(!strcmp(in_line, "K\ta Keystone Kop"))
  210. X!         ; /* do nothing */
  211. X          else
  212. X  #endif
  213. X! #ifndef WORM
  214. X!         if(!strcmp(in_line, "~\tthe tail of a long worm"))
  215. X!         ; /* do nothing */
  216. X!         else
  217. X  #endif
  218. X          (void) puts(in_line);
  219. X      }
  220. X      (void) fclose(stdin);
  221. X      (void) fclose(stdout);
  222. X***************
  223. X*** 550,562 ****
  224. X  # endif
  225. X  #endif /* MSDOS */
  226. X  
  227. X  #if defined(SMALLDATA) && defined(MACOS)
  228. X  void
  229. X  do_monst()
  230. X  {
  231. X!     Handle    data;
  232. X      short i,j;
  233. X      pmstr    *pmMonst;
  234. X      
  235. X      for(i = 0; mons[i].mlet; i++) {
  236. X          ;
  237. X--- 535,553 ----
  238. X  # endif
  239. X  #endif /* MSDOS */
  240. X  
  241. X+ 
  242. X  #if defined(SMALLDATA) && defined(MACOS)
  243. X  void
  244. X  do_monst()
  245. X  {
  246. X!     Handle    monstData, objData;
  247. X      short i,j;
  248. X      pmstr    *pmMonst;
  249. X+     SFReply    reply;
  250. X+     short    refNum,error;
  251. X+     Str255    name;
  252. X+     short    findNamedFile();
  253. X+     OSErr    write_resource();
  254. X      
  255. X      for(i = 0; mons[i].mlet; i++) {
  256. X          ;
  257. X***************
  258. X*** 574,636 ****
  259. X                  (long)sizeof(struct pmpart));
  260. X      }
  261. X      
  262. X!     PtrToHand((Ptr)pmMonst, &data, (long)(i * sizeof(struct pmstr)));
  263. X!     save_resource(data);
  264. X!     DisposHandle(data);
  265. X! }
  266. X! 
  267. X! 
  268. X! void
  269. X! save_resource(data)
  270. X! Handle    data;
  271. X! {
  272. X!     SFReply    reply;
  273. X!     short    refNum,error;
  274. X!     Str255    name;
  275. X!     ResType    theType;
  276. X!     Handle    theRes;
  277. X!     short    findNamedFile();
  278. X! #define MONST_DATA_ID    101
  279. X  
  280. X      strcpy((char *)&name[0], "\014Nethack.rsrc");
  281. X      if (findNamedFile(&name[1], 0, &reply)) {
  282. X!         strncpy((char *)&name[0],(char *)&reply.fName[1], reply.fName[0]);
  283. X!         name[reply.fName[0]] = '\0';
  284. X          if ((refNum = OpenResFile(name)) != -1) {
  285. X          if (ResError() == noErr) {
  286. X-             theType = HACK_DATA;
  287. X              strcpy((char *)&name[0], "\012MONST_DATA");
  288. X!             error = CurResFile();
  289. X!             if (theRes = GetResource(theType, MONST_DATA_ID)) {
  290. X!             RmveResource(theRes);
  291. X!             error = ResError();
  292. X!             if (error == noErr) {
  293. X!                 DisposHandle(theRes);
  294. X!                 UpdateResFile(refNum);
  295. X!                 error = ResError();
  296. X!                 if (error != noErr)
  297. X!                 SysBeep(1);
  298. X!             } else {
  299. X!                 Printf("Couldn't remove old copy of data resource.");
  300. X!                 return;
  301. X!             }
  302. X!             } else if (ResError() != resNotFound && ResError() != noErr) {
  303. X!             SysBeep(1);
  304. X!             Printf("Resource file is protected.");
  305. X!             return;
  306. X              }
  307. X!             AddResource(data, theType, MONST_DATA_ID, name);
  308. X!             error = ResError();
  309. X!             if (error != noErr) {
  310. X!             SysBeep(1);
  311. X!             Printf("Couldn't add data resource.");
  312. X!             } else {
  313. X!             WriteResource(data);
  314. X!             error = ResError();
  315. X!             if (error != noErr) {
  316. X!                 SysBeep(1);
  317. X!                 Printf("Couldn't write data resource.");
  318. X!             }
  319. X              }
  320. X              CloseResFile(refNum);
  321. X              if (ResError() != noErr) {
  322. X--- 565,594 ----
  323. X                  (long)sizeof(struct pmpart));
  324. X      }
  325. X      
  326. X!     PtrToHand((Ptr)pmMonst, &monstData, (long)(i * sizeof(struct pmstr)));
  327. X!     
  328. X!     /* store the object data, in Nethack the char * will be copied in */
  329. X!     for(i = 0; !i || objects[i].oc_olet != ILLOBJ_SYM; i++) {
  330. X!         ;
  331. X!     }
  332. X!     PtrToHand((Ptr)objects, &objData, ((i+1)*sizeof(struct objclass)));
  333. X  
  334. X      strcpy((char *)&name[0], "\014Nethack.rsrc");
  335. X      if (findNamedFile(&name[1], 0, &reply)) {
  336. X!         strncpy((char *)&name[0],(char *)&reply.fName[0], reply.fName[0]+1);
  337. X          if ((refNum = OpenResFile(name)) != -1) {
  338. X          if (ResError() == noErr) {
  339. X              strcpy((char *)&name[0], "\012MONST_DATA");
  340. X!             if (error = write_resource(monstData,
  341. X!                         MONST_DATA, name, refNum)) {
  342. X!                 SysBeep(1);
  343. X!                 Printf("Couldn't add monster data resource.\n");
  344. X              }
  345. X!             strcpy((char *)&name[0], "\013OBJECT_DATA");
  346. X!             if (error = write_resource(objData,
  347. X!                         OBJECT_DATA, name, refNum)) {
  348. X!                 SysBeep(1);
  349. X!                 Printf("Couldn't add object data resource.\n");
  350. X              }
  351. X              CloseResFile(refNum);
  352. X              if (ResError() != noErr) {
  353. X***************
  354. X*** 640,645 ****
  355. X--- 598,642 ----
  356. X          }
  357. X          }
  358. X      }
  359. X+     
  360. X+     DisposHandle(monstData);
  361. X+     DisposHandle(objData);
  362. X+ }
  363. X+ 
  364. X+ OSErr
  365. X+ write_resource(data, resID, resName, refNum)
  366. X+ Handle    data;
  367. X+ short    resID;
  368. X+ Str255    resName;
  369. X+ short    refNum;
  370. X+ {
  371. X+     ResType    theType;
  372. X+     short    error;
  373. X+     Handle    theRes;
  374. X+ 
  375. X+     theType = HACK_DATA;
  376. X+     error = CurResFile();
  377. X+     if (theRes = GetResource(theType, resID)) {
  378. X+         RmveResource(theRes);
  379. X+         error = ResError();
  380. X+         if (error == noErr) {
  381. X+             DisposHandle(theRes);
  382. X+             UpdateResFile(refNum);
  383. X+             error = ResError();
  384. X+         }
  385. X+         if (error != noErr) {
  386. X+             return error;
  387. X+         }
  388. X+     } else if (ResError() != resNotFound && ResError() != noErr) {
  389. X+             return (ResError());
  390. X+     }
  391. X+     AddResource(data, theType, resID, resName);
  392. X+     error = ResError();
  393. X+     if (error == noErr) {
  394. X+         WriteResource(data);
  395. X+         error = ResError();
  396. X+     }
  397. X+     return error;
  398. X  }
  399. X  # if defined(AZTEC) || defined(THINKC4)
  400. X  int
  401. X*** src/Old/mcastu.c    Sun Nov 19 13:41:36 1989
  402. X--- src/mcastu.c    Sun Oct 22 11:46:21 1989
  403. X***************
  404. X*** 72,78 ****
  405. X              dmg = 0;
  406. X          }
  407. X          break;
  408. X! #ifdef HARD
  409. X          case AD_MAGM:
  410. X          You("are hit by a shower of missiles!");
  411. X          if(Antimagic) {
  412. X--- 72,78 ----
  413. X              dmg = 0;
  414. X          }
  415. X          break;
  416. X! #ifdef INFERNO
  417. X          case AD_MAGM:
  418. X          You("are hit by a shower of missiles!");
  419. X          if(Antimagic) {
  420. X*** src/Old/mhitm.c    Sun Nov 19 13:41:53 1989
  421. X--- src/mhitm.c    Fri Nov 17 19:31:46 1989
  422. X***************
  423. X*** 1,4 ****
  424. X! /*    SCCS Id: @(#)mhitm.c    3.0    88/11/10
  425. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  426. X  /* NetHack may be freely redistributed.  See license for details. */
  427. X  
  428. X--- 1,4 ----
  429. X! /*    SCCS Id: @(#)mhitm.c    3.0    89/11/15
  430. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  431. X  /* NetHack may be freely redistributed.  See license for details. */
  432. X  
  433. X***************
  434. X*** 11,23 ****
  435. X  static long noisetime;
  436. X  static struct obj *otmp;
  437. X  
  438. X! static void mrustm P((struct monst *, struct monst *, struct obj *));
  439. X! static int hitmm P((struct monst *,struct monst *,struct attack *));
  440. X! static int gazemm P((struct monst *,struct monst *,struct attack *));
  441. X! static int gulpmm P((struct monst *,struct monst *,struct attack *));
  442. X! static int explmm P((struct monst *,struct monst *,struct attack *));
  443. X! static int mdamagem P((struct monst *,struct monst *,struct attack *));
  444. X! static void mswingsm P((struct monst *, struct monst *, struct obj *));
  445. X  
  446. X  static void
  447. X  noises(magr, mattk)
  448. X--- 11,23 ----
  449. X  static long noisetime;
  450. X  static struct obj *otmp;
  451. X  
  452. X! static void FDECL(mrustm, (struct monst *, struct monst *, struct obj *));
  453. X! static int FDECL(hitmm, (struct monst *,struct monst *,struct attack *));
  454. X! static int FDECL(gazemm, (struct monst *,struct monst *,struct attack *));
  455. X! static int FDECL(gulpmm, (struct monst *,struct monst *,struct attack *));
  456. X! static int FDECL(explmm, (struct monst *,struct monst *,struct attack *));
  457. X! static int FDECL(mdamagem, (struct monst *,struct monst *,struct attack *));
  458. X! static void FDECL(mswingsm, (struct monst *, struct monst *, struct obj *));
  459. X  
  460. X  static void
  461. X  noises(magr, mattk)
  462. X***************
  463. X*** 66,72 ****
  464. X      for(mon = fmon; mon; mon = mon->nmon)
  465. X          if(mon != mtmp) {
  466. X          if(dist2(mon->mx,mon->my,mtmp->mx,mtmp->my) < 3)
  467. X!             return(mattackm(mtmp,mon));
  468. X          }
  469. X      return(-1);
  470. X  }
  471. X--- 66,75 ----
  472. X      for(mon = fmon; mon; mon = mon->nmon)
  473. X          if(mon != mtmp) {
  474. X          if(dist2(mon->mx,mon->my,mtmp->mx,mtmp->my) < 3)
  475. X!         /* note: grid bug check needed here as well as in mattackm */
  476. X!             if(mtmp->data != &mons[PM_GRID_BUG] || mtmp->mx==mon->mx
  477. X!                 || mtmp->my==mon->my)
  478. X!             return(mattackm(mtmp,mon));
  479. X          }
  480. X      return(-1);
  481. X  }
  482. X***************
  483. X*** 91,96 ****
  484. X--- 94,102 ----
  485. X      if(!magr || !mdef) return(0);        /* mike@genat */
  486. X      pa = magr->data; pd = mdef->data;
  487. X      if(magr->mfroz) return(0);        /* riv05!a3 */
  488. X+     if(pa==&mons[PM_GRID_BUG] && magr->mx != mdef->mx
  489. X+                         && magr->my != mdef->my)
  490. X+         return(0);
  491. X  
  492. X  /*    Calculate the armour class differential.    */
  493. X  
  494. X*** src/Old/mhitu.c    Sun Nov 19 13:42:23 1989
  495. X--- src/mhitu.c    Fri Nov 17 19:31:51 1989
  496. X***************
  497. X*** 1,4 ****
  498. X! /*    SCCS Id: \@(#)mhitu.c    3.0    88/10/28
  499. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  500. X  /* NetHack may be freely redistributed.  See license for details. */
  501. X  
  502. X--- 1,4 ----
  503. X! /*    SCCS Id: @(#)mhitu.c    3.0    89/11/15
  504. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  505. X  /* NetHack may be freely redistributed.  See license for details. */
  506. X  
  507. X***************
  508. X*** 9,24 ****
  509. X  
  510. X  static struct obj *otmp;
  511. X  #ifdef POLYSELF
  512. X! static void urustm P((struct monst *, struct obj *));
  513. X! static int passiveum P((struct permonst *, struct monst *));
  514. X  #endif
  515. X  #ifdef SEDUCE
  516. X! static void mayberem P((struct obj *, char *));
  517. X  #endif
  518. X! static int hitmu P((struct monst *,struct attack *));
  519. X! static int gulpmu P((struct monst *,struct attack *));
  520. X! static int explmu P((struct monst *,struct attack *));
  521. X! static int gazemu P((struct monst *,struct attack *));
  522. X  
  523. X  
  524. X  static void
  525. X--- 9,24 ----
  526. X  
  527. X  static struct obj *otmp;
  528. X  #ifdef POLYSELF
  529. X! static void FDECL(urustm, (struct monst *, struct obj *));
  530. X! static int FDECL(passiveum, (struct permonst *, struct monst *));
  531. X  #endif
  532. X  #ifdef SEDUCE
  533. X! static void FDECL(mayberem, (struct obj *, char *));
  534. X  #endif
  535. X! static int FDECL(hitmu, (struct monst *,struct attack *));
  536. X! static int FDECL(gulpmu, (struct monst *,struct attack *));
  537. X! static int FDECL(explmu, (struct monst *,struct attack *));
  538. X! static int FDECL(gazemu, (struct monst *,struct attack *));
  539. X  
  540. X  
  541. X  static void
  542. X***************
  543. X*** 152,158 ****
  544. X  {
  545. X      unstuck(mtmp);
  546. X      mnexto(mtmp);
  547. X!     pru();
  548. X      spoteffects();
  549. X      /* to cover for a case where mtmp is not in a next square */
  550. X      if(um_dist(mtmp->mx,mtmp->my,1))
  551. X--- 152,158 ----
  552. X  {
  553. X      unstuck(mtmp);
  554. X      mnexto(mtmp);
  555. X!     prme();
  556. X      spoteffects();
  557. X      /* to cover for a case where mtmp is not in a next square */
  558. X      if(um_dist(mtmp->mx,mtmp->my,1))
  559. X***************
  560. X*** 177,183 ****
  561. X      struct    permonst *mdat = mtmp->data;
  562. X      boolean ranged = (dist(mtmp->mx, mtmp->my) > 3);
  563. X          /* Is it near you?  Affects your actions */
  564. X!     boolean range2 = (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) > 3);
  565. X          /* Does it think it's near you?  Affects its actions */
  566. X      boolean foundyou = (mtmp->mux==u.ux && mtmp->muy==u.uy);
  567. X          /* Is it attacking you or your image? */
  568. X--- 177,183 ----
  569. X      struct    permonst *mdat = mtmp->data;
  570. X      boolean ranged = (dist(mtmp->mx, mtmp->my) > 3);
  571. X          /* Is it near you?  Affects your actions */
  572. X!     boolean range2 = !monnear(mtmp, mtmp->mux, mtmp->muy);
  573. X          /* Does it think it's near you?  Affects its actions */
  574. X      boolean foundyou = (mtmp->mux==u.ux && mtmp->muy==u.uy);
  575. X          /* Is it attacking you or your image? */
  576. X***************
  577. X*** 280,286 ****
  578. X  
  579. X  /*    Special demon handling code */
  580. X      if(!mtmp->cham && is_demon(mdat) && !range2
  581. X! #ifdef HARD
  582. X         && mtmp->data != &mons[PM_BALROG]
  583. X         && mtmp->data != &mons[PM_SUCCUBUS]
  584. X         && mtmp->data != &mons[PM_INCUBUS]
  585. X--- 280,286 ----
  586. X  
  587. X  /*    Special demon handling code */
  588. X      if(!mtmp->cham && is_demon(mdat) && !range2
  589. X! #ifdef INFERNO
  590. X         && mtmp->data != &mons[PM_BALROG]
  591. X         && mtmp->data != &mons[PM_SUCCUBUS]
  592. X         && mtmp->data != &mons[PM_INCUBUS]
  593. X***************
  594. X*** 437,442 ****
  595. X--- 437,510 ----
  596. X  }
  597. X  
  598. X  /*
  599. X+  * helper function for some compilers that have trouble with hitmu
  600. X+  */
  601. X+ 
  602. X+ static
  603. X+ void
  604. X+ hurtarmor(mdat, attack)
  605. X+ struct permonst *mdat;
  606. X+ int attack;
  607. X+ {
  608. X+     boolean getbronze, rusting;
  609. X+     int    hurt;
  610. X+ 
  611. X+     rusting = (attack == AD_RUST);
  612. X+     if (rusting) {
  613. X+         hurt = 1;
  614. X+         getbronze = (mdat == &mons[PM_BLACK_PUDDING] &&
  615. X+                  uarm && is_corrodeable(uarm));
  616. X+     }
  617. X+     else {
  618. X+         hurt=2;
  619. X+         getbronze = FALSE;
  620. X+     }
  621. X+     /* What the following code does: it keeps looping until it
  622. X+      * finds a target for the rust monster.
  623. X+      * Head, feet, etc... not covered by metal, or covered by
  624. X+      * rusty metal, are not targets.  However, your body always
  625. X+      * is, no matter what covers it.
  626. X+      */
  627. X+     while (1) {
  628. X+         switch(rn2(5)) {
  629. X+         case 0:
  630. X+         if (!rust_dmg(uarmh, rusting ? "helmet" : "leather helmet",
  631. X+                      hurt, FALSE))
  632. X+             continue;
  633. X+         break;
  634. X+         case 1:
  635. X+         if (uarmc) break;
  636. X+         /* Note the difference between break and continue;
  637. X+          * break means it was hit and didn't rust; continue
  638. X+          * means it wasn't a target and though it didn't rust
  639. X+          * something else did.
  640. X+          */
  641. X+         if (getbronze)
  642. X+             (void)rust_dmg(uarm, "bronze armor", 3, TRUE);
  643. X+         else if (uarm)
  644. X+             (void)rust_dmg(uarm, xname(uarm), hurt, TRUE);
  645. X+         break;
  646. X+         case 2:
  647. X+         if (!rust_dmg(uarms, rusting ? "shield" : "wooden shield",
  648. X+                      hurt, FALSE))
  649. X+             continue;
  650. X+         break;
  651. X+         case 3:
  652. X+         if (!rust_dmg(uarmg, rusting ? "metal gauntlets" : "gloves",
  653. X+                      hurt, FALSE))
  654. X+             continue;
  655. X+         break;
  656. X+         case 4:
  657. X+         if (!rust_dmg(uarmf, rusting ? "metal boots" : "boots",
  658. X+                      hurt, FALSE))
  659. X+             continue;
  660. X+         break;
  661. X+         }
  662. X+         break; /* Out of while loop */
  663. X+     }
  664. X+ }
  665. X+ 
  666. X+ /*
  667. X   * hitmu: monster hits you
  668. X   *      returns 2 if monster dies (e.g. "yellow light"), 1 otherwise
  669. X   *      3 if the monster lives but teleported, so it can't keep attacking you
  670. X***************
  671. X*** 449,455 ****
  672. X  {
  673. X      register struct permonst *mdat = mtmp->data;
  674. X      register int dmg, ctmp, ptmp;
  675. X-     register boolean getbronze;
  676. X      char     buf[BUFSZ];
  677. X  #ifdef POLYSELF
  678. X      struct permonst *olduasmon = uasmon;
  679. X--- 517,522 ----
  680. X***************
  681. X*** 567,573 ****
  682. X              if(mtmp->m_lev > rn2(25))
  683. X              destroy_item(SPBOOK_SYM, AD_FIRE);
  684. X  #endif
  685. X!         }
  686. X          break;
  687. X          case AD_COLD:
  688. X          hitmsg(mtmp, mattk);
  689. X--- 634,640 ----
  690. X              if(mtmp->m_lev > rn2(25))
  691. X              destroy_item(SPBOOK_SYM, AD_FIRE);
  692. X  #endif
  693. X!         } else dmg = 0;
  694. X          break;
  695. X          case AD_COLD:
  696. X          hitmsg(mtmp, mattk);
  697. X***************
  698. X*** 579,585 ****
  699. X              }
  700. X              if(mtmp->m_lev > rn2(20))
  701. X              destroy_item(POTION_SYM, AD_COLD);
  702. X!         }
  703. X          break;
  704. X          case AD_ELEC:
  705. X          hitmsg(mtmp, mattk);
  706. X--- 646,652 ----
  707. X              }
  708. X              if(mtmp->m_lev > rn2(20))
  709. X              destroy_item(POTION_SYM, AD_COLD);
  710. X!         } else dmg = 0;
  711. X          break;
  712. X          case AD_ELEC:
  713. X          hitmsg(mtmp, mattk);
  714. X***************
  715. X*** 593,599 ****
  716. X              destroy_item(WAND_SYM, AD_ELEC);
  717. X              if(mtmp->m_lev > rn2(20))
  718. X              destroy_item(RING_SYM, AD_ELEC);
  719. X!         }
  720. X          break;
  721. X          case AD_SLEE:
  722. X          hitmsg(mtmp, mattk);
  723. X--- 660,666 ----
  724. X              destroy_item(WAND_SYM, AD_ELEC);
  725. X              if(mtmp->m_lev > rn2(20))
  726. X              destroy_item(RING_SYM, AD_ELEC);
  727. X!         } else dmg = 0;
  728. X          break;
  729. X          case AD_SLEE:
  730. X          hitmsg(mtmp, mattk);
  731. X***************
  732. X*** 671,678 ****
  733. X                  if (Blind) You("hear its hissing!");
  734. X                  else You("hear %s's hissing!", mon_nam(mtmp));
  735. X              if((!rn2(10) ||
  736. X!                 (flags.moonphase == NEW_MOON &&
  737. X!                  !carrying(DEAD_LIZARD)))
  738. X  #ifdef POLYSELF
  739. X                  && !resists_ston(uasmon)
  740. X  #endif
  741. X--- 738,744 ----
  742. X                  if (Blind) You("hear its hissing!");
  743. X                  else You("hear %s's hissing!", mon_nam(mtmp));
  744. X              if((!rn2(10) ||
  745. X!                 (flags.moonphase == NEW_MOON && !have_lizard()))
  746. X  #ifdef POLYSELF
  747. X                  && !resists_ston(uasmon)
  748. X  #endif
  749. X***************
  750. X*** 766,775 ****
  751. X              rloc(mtmp);
  752. X              return 3;
  753. X              }
  754. X!         } else if(steal(mtmp)) {
  755. X              rloc(mtmp);
  756. X              mtmp->mflee = 1;
  757. X              return 3;
  758. X          }
  759. X          break;
  760. X  #ifdef SEDUCE
  761. X--- 832,848 ----
  762. X              rloc(mtmp);
  763. X              return 3;
  764. X              }
  765. X!         } else {
  766. X!             switch (steal(mtmp)) {
  767. X!               case -1:
  768. X!             return 2;
  769. X!               case 0:
  770. X!             break;
  771. X!               default:
  772. X              rloc(mtmp);
  773. X              mtmp->mflee = 1;
  774. X              return 3;
  775. X+             }
  776. X          }
  777. X          break;
  778. X  #ifdef SEDUCE
  779. X***************
  780. X*** 807,850 ****
  781. X          }
  782. X  #endif /* GOLEMS */
  783. X  #endif
  784. X!         /* What the following code does: it keeps looping until it
  785. X!          * finds a target for the rust monster.
  786. X!          * Head, feet, etc... not covered by metal, or covered by
  787. X!          * rusty metal, are not targets.  However, your body always
  788. X!          * is, no matter what covers it.
  789. X!          */
  790. X!         getbronze = (mdat == &mons[PM_BLACK_PUDDING] &&
  791. X!                  uarm && is_corrodeable(uarm));
  792. X!         while (1) {
  793. X!             switch(rn2(5)) {
  794. X!             case 0:
  795. X!             if (!rust_dmg(uarmh, "helmet", 1, FALSE)) continue;
  796. X!             break;
  797. X!             case 1:
  798. X!             if (uarmc) break;
  799. X!             /* Note the difference between break and continue;
  800. X!              * break means it was hit and didn't rust; continue
  801. X!              * means it wasn't a target and though it didn't rust
  802. X!              * something else did.
  803. X!              */
  804. X!             if (getbronze)
  805. X!                 (void)rust_dmg(uarm, "bronze armor", 3, TRUE);
  806. X!             else
  807. X!                 (void)rust_dmg(uarm, "armor", 1, TRUE);
  808. X!             break;
  809. X!             case 2:
  810. X!             if (!rust_dmg(uarms, "shield", 1, FALSE)) continue;
  811. X!             break;
  812. X!             case 3:
  813. X!             if (!rust_dmg(uarmg, "metal gauntlets", 1, FALSE))
  814. X!                 continue;
  815. X!             break;
  816. X!             case 4:
  817. X!             if (!rust_dmg(uarmf, "metal boots", 1, FALSE)) continue;
  818. X!             break;
  819. X!             }
  820. X!             break; /* Out of while loop */
  821. X!         }
  822. X          break;
  823. X          case AD_DCAY:
  824. X          hitmsg(mtmp, mattk);
  825. X--- 880,886 ----
  826. X          }
  827. X  #endif /* GOLEMS */
  828. X  #endif
  829. X!         hurtarmor(mdat, AD_RUST);
  830. X          break;
  831. X          case AD_DCAY:
  832. X          hitmsg(mtmp, mattk);
  833. X***************
  834. X*** 859,887 ****
  835. X          }
  836. X  #endif /* GOLEMS */
  837. X  #endif
  838. X!         while (1) {
  839. X!             switch(rn2(5)) {
  840. X!             case 0:
  841. X!             if (!rust_dmg(uarmh, "leather helmet", 2, FALSE))
  842. X!                 continue;
  843. X!             break;
  844. X!             case 1:
  845. X!             if (uarmc) break;
  846. X!             if (uarm) (void)rust_dmg(uarm, xname(uarm), 2, TRUE);
  847. X!             break;
  848. X!             case 2:
  849. X!             if (!rust_dmg(uarms, "wooden shield", 2, FALSE))
  850. X!                 continue;
  851. X!             break;
  852. X!             case 3:
  853. X!             if (!rust_dmg(uarmg, "gloves", 2, FALSE)) continue;
  854. X!             break;
  855. X!             case 4:
  856. X!             if (!rust_dmg(uarmf, "boots", 2, FALSE)) continue;
  857. X!             break;
  858. X!             }
  859. X!             break; /* Out of while loop */
  860. X!         }
  861. X          break;
  862. X          case AD_HEAL:
  863. X          if(!uwep
  864. X--- 895,901 ----
  865. X          }
  866. X  #endif /* GOLEMS */
  867. X  #endif
  868. X!         hurtarmor(mdat, AD_DCAY);
  869. X          break;
  870. X          case AD_HEAL:
  871. X          if(!uwep
  872. X***************
  873. X*** 889,895 ****
  874. X             && !uarmu
  875. X  #endif
  876. X             && !uarm && !uarmh && !uarms && !uarmg && !uarmc && !uarmf) {
  877. X!             kludge("%s hits! (I hope you don't mind.)", Monnam(mtmp));
  878. X  #ifdef POLYSELF
  879. X              if (u.mtimedone) {
  880. X                  u.mh += rnd(7);
  881. X--- 903,909 ----
  882. X             && !uarmu
  883. X  #endif
  884. X             && !uarm && !uarmh && !uarms && !uarmg && !uarmc && !uarmf) {
  885. X!             kludge("%s hits!  (I hope you don't mind.)", Monnam(mtmp));
  886. X  #ifdef POLYSELF
  887. X              if (u.mtimedone) {
  888. X                  u.mh += rnd(7);
  889. X***************
  890. X*** 911,917 ****
  891. X          } else
  892. X              if(pl_character[0] == 'H') {
  893. X                  if (flags.soundok && !(moves % 5))
  894. X!                 pline("'Doc, I can't help you unless you cooperate.'");
  895. X                  dmg = 0;
  896. X              } else hitmsg(mtmp, mattk);
  897. X          break;
  898. X--- 925,931 ----
  899. X          } else
  900. X              if(pl_character[0] == 'H') {
  901. X                  if (flags.soundok && !(moves % 5))
  902. X!                 verbalize("Doc, I can't help you unless you cooperate.");
  903. X                  dmg = 0;
  904. X              } else hitmsg(mtmp, mattk);
  905. X          break;
  906. X***************
  907. X*** 971,977 ****
  908. X          if(flags.soundok && !rn2(3)) cuss(mtmp);
  909. X          dmg = 0;
  910. X          break;
  911. X! #ifdef HARD /* a non-gaze AD_CONF exists only for one of the demons */
  912. X          case AD_CONF:
  913. X          hitmsg(mtmp, mattk);
  914. X          if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
  915. X--- 985,991 ----
  916. X          if(flags.soundok && !rn2(3)) cuss(mtmp);
  917. X          dmg = 0;
  918. X          break;
  919. X! #ifdef INFERNO /* a non-gaze AD_CONF exists only for one of the demons */
  920. X          case AD_CONF:
  921. X          hitmsg(mtmp, mattk);
  922. X          if(!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
  923. X***************
  924. X*** 1026,1031 ****
  925. X--- 1040,1049 ----
  926. X          u.ustuck = mtmp;
  927. X          pmon(mtmp);
  928. X          kludge("%s engulfs you!", Monnam(mtmp));
  929. X+         if (u.utrap) {
  930. X+             You("are released from the trap!");
  931. X+             u.utrap = 0;
  932. X+         }
  933. X  #ifdef WALKIES
  934. X          if((i = number_leashed()) > 0) {
  935. X              pline("The leash%s snap%s loose...",
  936. X***************
  937. X*** 1074,1080 ****
  938. X              } else
  939. X  #endif
  940. X              if (Hallucination) pline("Ouch!  You've been slimed!");
  941. X!             else You("are covered in slime!  It burns!!!");
  942. X              break;
  943. X          case AD_BLND:
  944. X              if(!Blind) {
  945. X--- 1092,1098 ----
  946. X              } else
  947. X  #endif
  948. X              if (Hallucination) pline("Ouch!  You've been slimed!");
  949. X!             else You("are covered in slime!  It burns!");
  950. X              break;
  951. X          case AD_BLND:
  952. X              if(!Blind) {
  953. X***************
  954. X*** 1120,1126 ****
  955. X              } else You("are burning to a crisp!");
  956. X              } else tmp = 0;
  957. X              break;
  958. X! #ifdef HARD
  959. X          case AD_DISE:
  960. X              if (!Sick) You("feel very sick.");
  961. X              make_sick(Sick + (long)rn1(25-ACURR(A_CON),15),FALSE);
  962. X--- 1138,1144 ----
  963. X              } else You("are burning to a crisp!");
  964. X              } else tmp = 0;
  965. X              break;
  966. X! #ifdef INFERNO
  967. X          case AD_DISE:
  968. X              if (!Sick) You("feel very sick.");
  969. X              make_sick(Sick + (long)rn1(25-ACURR(A_CON),15),FALSE);
  970. X***************
  971. X*** 1246,1252 ****
  972. X              make_confused(HConfusion + conf, FALSE);
  973. X          }
  974. X          break;
  975. X! #ifdef HARD
  976. X          case AD_STUN:
  977. X          if(!mtmp->mcan && canseemon(mtmp) && mtmp->mcansee &&
  978. X                      !mtmp->mspec_used && rn2(5)) {
  979. X--- 1264,1270 ----
  980. X              make_confused(HConfusion + conf, FALSE);
  981. X          }
  982. X          break;
  983. X! #ifdef INFERNO
  984. X          case AD_STUN:
  985. X          if(!mtmp->mcan && canseemon(mtmp) && mtmp->mcansee &&
  986. X                      !mtmp->mspec_used && rn2(5)) {
  987. X***************
  988. X*** 1351,1357 ****
  989. X          return 0;
  990. X  
  991. X      if(pagr->mlet != S_NYMPH
  992. X! #ifdef HARD
  993. X          && ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
  994. X  # ifdef SEDUCE
  995. X              || (mattk && mattk->adtyp != AD_SSEX)
  996. X--- 1369,1375 ----
  997. X          return 0;
  998. X  
  999. X      if(pagr->mlet != S_NYMPH
  1000. X! #ifdef INFERNO
  1001. X          && ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
  1002. X  # ifdef SEDUCE
  1003. X              || (mattk && mattk->adtyp != AD_SSEX)
  1004. X***************
  1005. X*** 1606,1612 ****
  1006. X              (obj == uarmu) ? "let me massage you" :
  1007. X  #endif
  1008. X              /* obj == uarmh */
  1009. X!             "so I can run my fingers through your hair");
  1010. X  
  1011. X      if (obj == uarm)  (void) Armor_off();
  1012. X      else if (obj == uarmc) (void) Cloak_off();
  1013. X--- 1624,1630 ----
  1014. X              (obj == uarmu) ? "let me massage you" :
  1015. X  #endif
  1016. X              /* obj == uarmh */
  1017. X!             "let me run my fingers through your hair");
  1018. X  
  1019. X      if (obj == uarm)  (void) Armor_off();
  1020. X      else if (obj == uarmc) (void) Cloak_off();
  1021. X*** src/Old/mklev.c    Sun Nov 19 13:43:28 1989
  1022. X--- src/mklev.c    Thu Nov  9 20:27:10 1989
  1023. X***************
  1024. X*** 394,400 ****
  1025. X                  (void) mksobj_at(BOULDER, xx, yy);
  1026. X          } else {
  1027. X              crm->typ = SCORR;
  1028. X!             crm->scrsym = STONE_SYM;
  1029. X          }
  1030. X          } else
  1031. X          if(crm->typ != CORR && crm->typ != SCORR) {
  1032. X--- 394,400 ----
  1033. X                  (void) mksobj_at(BOULDER, xx, yy);
  1034. X          } else {
  1035. X              crm->typ = SCORR;
  1036. X!             crm->scrsym = ' ';    /* _not_ STONE_SYM */
  1037. X          }
  1038. X          } else
  1039. X          if(crm->typ != CORR && crm->typ != SCORR) {
  1040. X***************
  1041. X*** 498,504 ****
  1042. X          type = DOOR;
  1043. X      levl[x][y].typ = type;
  1044. X      if(type == DOOR) {
  1045. X-         levl[x][y].scrsym = DOOR_SYM;
  1046. X          if(!rn2(3)) {      /* is it a locked door, closed, or a doorway? */
  1047. X          if(!rn2(5))
  1048. X              levl[x][y].doormask = D_ISOPEN;
  1049. X--- 498,503 ----
  1050. X***************
  1051. X*** 509,518 ****
  1052. X  
  1053. X          if (levl[x][y].doormask != D_ISOPEN && !shdoor && !rn2(25))
  1054. X              levl[x][y].doormask |= D_TRAPPED;
  1055. X!         } else {
  1056. X!         if(shdoor)    levl[x][y].doormask = D_ISOPEN;
  1057. X!         else        levl[x][y].doormask = D_NODOOR;
  1058. X!         }
  1059. X      } else { /* SDOOR */
  1060. X          if(shdoor || !rn2(5))    levl[x][y].doormask = D_LOCKED;
  1061. X          else            levl[x][y].doormask = D_CLOSED;
  1062. X--- 508,516 ----
  1063. X  
  1064. X          if (levl[x][y].doormask != D_ISOPEN && !shdoor && !rn2(25))
  1065. X              levl[x][y].doormask |= D_TRAPPED;
  1066. X!         } else
  1067. X!         levl[x][y].doormask = (shdoor ? D_ISOPEN : D_NODOOR);
  1068. X!         levl[x][y].scrsym = news0(x,y);
  1069. X      } else { /* SDOOR */
  1070. X          if(shdoor || !rn2(5))    levl[x][y].doormask = D_LOCKED;
  1071. X          else            levl[x][y].doormask = D_CLOSED;
  1072. X***************
  1073. X*** 599,605 ****
  1074. X          if(trap_type || !rn2(4)) {
  1075. X  
  1076. X          rm->typ = SCORR;
  1077. X!         rm->scrsym = STONE_SYM;
  1078. X          if(trap_type) {
  1079. X              ttmp = maketrap(xx, yy+dy, trap_type);
  1080. X              ttmp->once = 1;
  1081. X--- 597,603 ----
  1082. X          if(trap_type || !rn2(4)) {
  1083. X  
  1084. X          rm->typ = SCORR;
  1085. X!         rm->scrsym = ' ';        /* _not_ STONE_SYM */
  1086. X          if(trap_type) {
  1087. X              ttmp = maketrap(xx, yy+dy, trap_type);
  1088. X              ttmp->once = 1;
  1089. X***************
  1090. X*** 787,799 ****
  1091. X  #ifdef MEDUSA
  1092. X      if (dlevel == medusa_level) {
  1093. X          struct monst *mtmp;
  1094. X  
  1095. X          if (mtmp = makemon(&mons[PM_MEDUSA], xdnstair, ydnstair))
  1096. X              mtmp->msleep = 1;
  1097. X          for (tryct = rn1(1,3); tryct; tryct--) {
  1098. X              x = somex(croom); y = somey(croom);
  1099. X!             if (goodpos(x,y,(struct permonst *)0))
  1100. X!                 (void) mk_tt_object(STATUE, x, y);
  1101. X          }
  1102. X      }
  1103. X  #endif
  1104. X--- 785,803 ----
  1105. X  #ifdef MEDUSA
  1106. X      if (dlevel == medusa_level) {
  1107. X          struct monst *mtmp;
  1108. X+         struct obj *otmp;
  1109. X  
  1110. X          if (mtmp = makemon(&mons[PM_MEDUSA], xdnstair, ydnstair))
  1111. X              mtmp->msleep = 1;
  1112. X          for (tryct = rn1(1,3); tryct; tryct--) {
  1113. X              x = somex(croom); y = somey(croom);
  1114. X!             if (goodpos(x,y,(struct permonst *)0)) {
  1115. X!                 otmp = mk_tt_object(STATUE, x, y);
  1116. X!                 while(resists_ston(&mons[otmp->corpsenm])) {
  1117. X!                     otmp->corpsenm = rndmonnum();
  1118. X!                     otmp->owt = weight(otmp);
  1119. X!                 }
  1120. X!             }
  1121. X          }
  1122. X      }
  1123. X  #endif
  1124. X***************
  1125. X*** 922,937 ****
  1126. X          /* put statues inside */
  1127. X  #ifdef MEDUSA
  1128. X          if(!rn2(dlevel == medusa_level ? 1 : 20)) {
  1129. X              if (!rn2(dlevel == medusa_level ? 2 : 50))
  1130. X!                 (void) mk_tt_object(STATUE,
  1131. X                          somex(croom), somey(croom));
  1132. X              else {
  1133. X!                 struct obj *otmp =
  1134. X!                     mkcorpstat(STATUE, (struct permonst *)0,
  1135. X                          somex(croom), somey(croom));
  1136. X!                 if (dlevel == medusa_level && otmp) 
  1137. X!                     otmp->spe = 0;
  1138. X                  /* Medusa statues don't contain books */
  1139. X              }
  1140. X          }
  1141. X  #else
  1142. X--- 926,947 ----
  1143. X          /* put statues inside */
  1144. X  #ifdef MEDUSA
  1145. X          if(!rn2(dlevel == medusa_level ? 1 : 20)) {
  1146. X+             struct obj *otmp;
  1147. X+ 
  1148. X              if (!rn2(dlevel == medusa_level ? 2 : 50))
  1149. X!                 otmp = mk_tt_object(STATUE,
  1150. X                          somex(croom), somey(croom));
  1151. X              else {
  1152. X!                 otmp = mkcorpstat(STATUE, (struct permonst *)0,
  1153. X                          somex(croom), somey(croom));
  1154. X!             }
  1155. X!             if (dlevel == medusa_level && otmp) {
  1156. X                  /* Medusa statues don't contain books */
  1157. X+                 otmp->spe = 0;
  1158. X+                 while(resists_ston(&mons[otmp->corpsenm])) {
  1159. X+                     otmp->corpsenm = rndmonnum();
  1160. X+                     otmp->owt = weight(otmp);
  1161. X+                 }
  1162. X              }
  1163. X          }
  1164. X  #else
  1165. X***************
  1166. X*** 1117,1123 ****
  1167. X  
  1168. X          if((mtmp = makemon(mkclass(S_MIMIC), mx, my))) {
  1169. X              mtmp->mimic = 1;
  1170. X!             mtmp->mappearance = DOOR_SYM;
  1171. X          }
  1172. X          return;
  1173. X      }
  1174. X--- 1127,1133 ----
  1175. X  
  1176. X          if((mtmp = makemon(mkclass(S_MIMIC), mx, my))) {
  1177. X              mtmp->mimic = 1;
  1178. X!             mtmp->mappearance = CLOSED_DOOR_SYM;
  1179. X          }
  1180. X          return;
  1181. X      }
  1182. X*** src/Old/mkmaze.c    Sun Nov 19 13:44:08 1989
  1183. X--- src/mkmaze.c    Mon Oct 30 17:31:22 1989
  1184. X***************
  1185. X*** 26,32 ****
  1186. X  int x1, y1, x2, y2;
  1187. X  boolean see;
  1188. X  {
  1189. X!     char type;
  1190. X      short x,y;
  1191. X      register struct rm *room;
  1192. X  
  1193. X--- 26,32 ----
  1194. X  int x1, y1, x2, y2;
  1195. X  boolean see;
  1196. X  {
  1197. X!     uchar type;
  1198. X      short x,y;
  1199. X      register struct rm *room;
  1200. X  
  1201. X***************
  1202. X*** 43,144 ****
  1203. X          room = &levl[x][y];
  1204. X          type = room->typ;
  1205. X          if (iswall(x,y)) {
  1206. X!             if (IS_DOOR(type)) {
  1207. X!             room->scrsym = DOOR_SYM;
  1208. X!             continue;
  1209. X!             } else
  1210. X              if (iswall(x,y-1))
  1211. X              if (iswall(x,y+1))
  1212. X                  if (iswall(x-1,y))
  1213. X!                 if (iswall(x+1,y)) {
  1214. X!                     room->scrsym = CRWALL_SYM; /* -+- */
  1215. X                      room->typ = CROSSWALL;
  1216. X!                 } else {
  1217. X!                     room->scrsym = TLWALL_SYM; /* -| */
  1218. X                      room->typ = TLWALL;
  1219. X-                 }
  1220. X                  else
  1221. X!                 if (iswall(x+1,y)) {
  1222. X!                     room->scrsym = TRWALL_SYM; /* |- */
  1223. X                      room->typ = TRWALL;
  1224. X!                 } else {
  1225. X                      room->typ = VWALL;
  1226. X- #ifdef STRONGHOLD
  1227. X-                     if (is_drawbridge_wall(x,y) >= 0)
  1228. X-                         room->scrsym = DB_VWALL_SYM;
  1229. X-                     else
  1230. X- #endif
  1231. X-                         room->scrsym = VWALL_SYM; /* | */
  1232. X-                 }
  1233. X              else
  1234. X                  if (iswall(x-1,y))
  1235. X!                 if (iswall(x+1,y)) {              
  1236. X!                     room->scrsym = TUWALL_SYM;  /*  |  */
  1237. X!                     room->typ = TUWALL;        /* -+- */
  1238. X!                 } else {
  1239. X!                     room->scrsym = BRCORN_SYM;  /*    | */
  1240. X!                     room->typ = BRCORNER;        /* -+ */
  1241. X!                 }
  1242. X                  else
  1243. X!                 if (iswall(x+1,y)) {            
  1244. X!                     room->scrsym = BLCORN_SYM;  /* |  */
  1245. X!                     room->typ = BLCORNER;        /* +- */
  1246. X!                 } else {
  1247. X                      room->typ = VWALL;
  1248. X- #ifdef STRONGHOLD
  1249. X-                     if (is_drawbridge_wall(x,y) >= 0)
  1250. X-                         room->scrsym = DB_VWALL_SYM;
  1251. X-                     else
  1252. X- #endif
  1253. X-                         room->scrsym = VWALL_SYM; /* | */
  1254. X-                 }
  1255. X              else
  1256. X              if (iswall(x,y+1))
  1257. X                  if (iswall(x-1,y))
  1258. X!                 if (iswall(x+1,y)) {
  1259. X!                     room->scrsym = TDWALL_SYM;  /* -+- */
  1260. X!                     room->typ = TDWALL;        /*    | */
  1261. X!                 } else {
  1262. X!                     room->scrsym = TRCORN_SYM;  /* -+ */
  1263. X!                     room->typ = TRCORNER;        /*    | */
  1264. X!                 }
  1265. X                  else
  1266. X!                 if (iswall(x+1,y)) {
  1267. X!                     room->scrsym = TLCORN_SYM;  /* +- */
  1268. X!                     room->typ = TLCORNER;        /* |  */
  1269. X!                 } else {
  1270. X                      room->typ = VWALL;
  1271. X! #ifdef STRONGHOLD
  1272. X!                     if (is_drawbridge_wall(x,y) >= 0)
  1273. X!                         room->scrsym = DB_VWALL_SYM;
  1274. X!                     else
  1275. X! #endif
  1276. X!                         room->scrsym = VWALL_SYM; /* | */
  1277. X!                 }
  1278. X!             else {
  1279. X                  room->typ = HWALL;
  1280. X- #ifdef STRONGHOLD
  1281. X-                 if (is_drawbridge_wall(x,y) >= 0)
  1282. X-                     room->scrsym = DB_HWALL_SYM;
  1283. X-                 else
  1284. X- #endif
  1285. X-                     room->scrsym = HWALL_SYM;
  1286. X-             }
  1287. X              if (type == SDOOR) room->typ = type;
  1288. X-             if (see) room->seen = 0;
  1289. X-         } else {
  1290. X-             switch(room->typ) {
  1291. X-             case STONE:
  1292. X-                 room->scrsym = STONE_SYM;
  1293. X-                 break;
  1294. X-             case CORR:
  1295. X-                 room->scrsym = CORR_SYM;
  1296. X-                 break;
  1297. X-             case ROOM:
  1298. X-                 room->scrsym = ROOM_SYM;
  1299. X-             }
  1300. X-             if (see) room->seen = 0;
  1301. X          }
  1302. X          }
  1303. X  }
  1304. X  #endif /* WALLIFIED_MAZE /**/
  1305. X--- 43,92 ----
  1306. X          room = &levl[x][y];
  1307. X          type = room->typ;
  1308. X          if (iswall(x,y)) {
  1309. X!           if (IS_DOOR(type))
  1310. X!             continue;
  1311. X!           else
  1312. X              if (iswall(x,y-1))
  1313. X              if (iswall(x,y+1))
  1314. X                  if (iswall(x-1,y))
  1315. X!                 if (iswall(x+1,y))
  1316. X                      room->typ = CROSSWALL;
  1317. X!                 else
  1318. X                      room->typ = TLWALL;
  1319. X                  else
  1320. X!                 if (iswall(x+1,y))
  1321. X                      room->typ = TRWALL;
  1322. X!                 else
  1323. X                      room->typ = VWALL;
  1324. X              else
  1325. X                  if (iswall(x-1,y))
  1326. X!                 if (iswall(x+1,y))
  1327. X!                     room->typ = TUWALL;
  1328. X!                 else
  1329. X!                     room->typ = BRCORNER;
  1330. X                  else
  1331. X!                 if (iswall(x+1,y))
  1332. X!                     room->typ = BLCORNER;
  1333. X!                 else
  1334. X                      room->typ = VWALL;
  1335. X              else
  1336. X              if (iswall(x,y+1))
  1337. X                  if (iswall(x-1,y))
  1338. X!                 if (iswall(x+1,y))
  1339. X!                     room->typ = TDWALL;
  1340. X!                 else
  1341. X!                     room->typ = TRCORNER;
  1342. X                  else
  1343. X!                 if (iswall(x+1,y))
  1344. X!                     room->typ = TLCORNER;
  1345. X!                 else
  1346. X                      room->typ = VWALL;
  1347. X!             else
  1348. X                  room->typ = HWALL;
  1349. X              if (type == SDOOR) room->typ = type;
  1350. X          }
  1351. X+         room->scrsym = news0(x,y);
  1352. X+         if (see) room->seen = 0;
  1353. X          }
  1354. X  }
  1355. X  #endif /* WALLIFIED_MAZE /**/
  1356. X***************
  1357. X*** 273,286 ****
  1358. X          if(mtmp = makemon(&mons[PM_HELL_HOUND], zx+1, zy))
  1359. X          mtmp->msleep = 1;
  1360. X          (void) makemon(&mons[PM_KRAKEN], zx+2, zy+2);
  1361. X          if (dlevel == wiz_level) {
  1362. X  
  1363. X          (void) mksobj_at(AMULET_OF_YENDOR, zx, zy);
  1364. X          flags.made_amulet = 1;
  1365. X- #ifndef STRONGHOLD
  1366. X-         if(mtmp = makemon(&mons[PM_VLAD_THE_IMPALER], zx-1, zy))
  1367. X-             mtmp->msleep = 1;
  1368. X- #endif
  1369. X          if(mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], zx, zy))
  1370. X              mtmp->msleep = 1;
  1371. X          } else {
  1372. X--- 221,232 ----
  1373. X          if(mtmp = makemon(&mons[PM_HELL_HOUND], zx+1, zy))
  1374. X          mtmp->msleep = 1;
  1375. X          (void) makemon(&mons[PM_KRAKEN], zx+2, zy+2);
  1376. X+         if (mtmp = makemon(&mons[PM_VAMPIRE_LORD], zx-1, zy))
  1377. X+         mtmp->msleep = 1;
  1378. X          if (dlevel == wiz_level) {
  1379. X  
  1380. X          (void) mksobj_at(AMULET_OF_YENDOR, zx, zy);
  1381. X          flags.made_amulet = 1;
  1382. X          if(mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], zx, zy))
  1383. X              mtmp->msleep = 1;
  1384. X          } else {
  1385. X***************
  1386. X*** 288,297 ****
  1387. X              /* make a cheap plastic imitation */
  1388. X          if (ot = mksobj_at(AMULET_OF_YENDOR, zx, zy))
  1389. X              ot-> spe = -1;
  1390. X- #ifndef STRONGHOLD
  1391. X-         if (mtmp = makemon(&mons[PM_VAMPIRE_LORD], zx-1, zy))
  1392. X-             mtmp->msleep = 1;
  1393. X- #endif
  1394. X          (void) makemon(&mons[dprince()], zx, zy);
  1395. X          }
  1396. X          /* they should wake up when we intrude */
  1397. X--- 234,239 ----
  1398. X***************
  1399. X*** 317,353 ****
  1400. X      wallification(2, 2, x_maze_max, y_maze_max, TRUE);
  1401. X  #else
  1402. X      for(x = 2; x < x_maze_max; x++)
  1403. X!         for(y = 2; y < y_maze_max; y++) {
  1404. X!             switch(levl[x][y].typ) {
  1405. X!             case STONE:
  1406. X!                 levl[x][y].scrsym = STONE_SYM;
  1407. X!                 break;
  1408. X!             case CORR:
  1409. X!                 levl[x][y].scrsym = CORR_SYM;
  1410. X!                 break;
  1411. X!             case ROOM:
  1412. X!                 levl[x][y].scrsym = ROOM_SYM;
  1413. X!                 break;
  1414. X!             case HWALL:
  1415. X!                 levl[x][y].scrsym = HWALL_SYM;
  1416. X!                 break;
  1417. X!             case VWALL:
  1418. X!                 levl[x][y].scrsym = VWALL_SYM;
  1419. X!                 break;
  1420. X!             case TLCORNER:
  1421. X!                 levl[x][y].scrsym = TLCORN_SYM;
  1422. X!                 break;
  1423. X!             case TRCORNER:
  1424. X!                 levl[x][y].scrsym = TRCORN_SYM;
  1425. X!                 break;
  1426. X!             case BLCORNER:
  1427. X!                 levl[x][y].scrsym = BLCORN_SYM;
  1428. X!                 break;
  1429. X!             case BRCORNER:
  1430. X!                 levl[x][y].scrsym = BRCORN_SYM;
  1431. X!                 break;
  1432. X!             }
  1433. X!         }
  1434. X  #endif
  1435. X      mazexy(&mm);
  1436. X      levl[(xupstair = mm.x)][(yupstair = mm.y)].scrsym = UP_SYM;
  1437. X--- 259,266 ----
  1438. X      wallification(2, 2, x_maze_max, y_maze_max, TRUE);
  1439. X  #else
  1440. X      for(x = 2; x < x_maze_max; x++)
  1441. X!         for(y = 2; y < y_maze_max; y++)
  1442. X!             levl[x][y].scrsym = news0(x,y);
  1443. X  #endif
  1444. X      mazexy(&mm);
  1445. X      levl[(xupstair = mm.x)][(yupstair = mm.y)].scrsym = UP_SYM;
  1446. X*** src/Old/mkobj.c    Sun Nov 19 13:44:30 1989
  1447. X--- src/mkobj.c    Thu Nov  9 20:27:13 1989
  1448. X***************
  1449. X*** 1,4 ****
  1450. X! /*    SCCS Id: @(#)mkobj.c    3.0    88/10/30
  1451. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1452. X  /* NetHack may be freely redistributed.  See license for details. */
  1453. X  
  1454. X--- 1,4 ----
  1455. X! /*    SCCS Id: @(#)mkobj.c    3.0    89/11/08
  1456. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1457. X  /* NetHack may be freely redistributed.  See license for details. */
  1458. X  
  1459. X***************
  1460. X*** 257,263 ****
  1461. X              else        otmp->corpsenm = -1; /* empty */
  1462. X              } else        otmp->corpsenm = -1; /* empty */
  1463. X          } else if(otmp->otyp == TIN) {
  1464. X!             if(!rn2(10)) {
  1465. X              otmp->spe = 1;        /* spinach */
  1466. X              otmp->corpsenm = -1;
  1467. X              } else do {
  1468. X--- 257,263 ----
  1469. X              else        otmp->corpsenm = -1; /* empty */
  1470. X              } else        otmp->corpsenm = -1; /* empty */
  1471. X          } else if(otmp->otyp == TIN) {
  1472. X!             if(!rn2(6)) {
  1473. X              otmp->spe = 1;        /* spinach */
  1474. X              otmp->corpsenm = -1;
  1475. X              } else do {
  1476. X***************
  1477. X*** 448,454 ****
  1478. X  }
  1479. X  
  1480. X  int
  1481. X! letter(c) {
  1482. X      return(('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
  1483. X  }
  1484. X  
  1485. X--- 448,456 ----
  1486. X  }
  1487. X  
  1488. X  int
  1489. X! letter(c)
  1490. X! int c;
  1491. X! {
  1492. X      return(('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
  1493. X  }
  1494. X  
  1495. X***************
  1496. X*** 507,513 ****
  1497. X      register struct obj *otmp;
  1498. X  
  1499. X      if(objtype != CORPSE && objtype != STATUE)
  1500. X!         impossible("making corpstate type %d", objtype);
  1501. X      otmp = mksobj_at(objtype, x, y);
  1502. X      if(otmp)  {
  1503. X          if(ptr)    otmp->corpsenm = monsndx(ptr);
  1504. X--- 509,515 ----
  1505. X      register struct obj *otmp;
  1506. X  
  1507. X      if(objtype != CORPSE && objtype != STATUE)
  1508. X!         impossible("making corpstat type %d", objtype);
  1509. X      otmp = mksobj_at(objtype, x, y);
  1510. X      if(otmp)  {
  1511. X          if(ptr)    otmp->corpsenm = monsndx(ptr);
  1512. X*** src/Old/mon.c    Sun Nov 19 13:45:31 1989
  1513. X--- src/mon.c    Sun Nov 19 09:45:11 1989
  1514. X***************
  1515. X*** 1,16 ****
  1516. X! /*    SCCS Id: @(#)mon.c    3.0    88/10/31
  1517. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1518. X  /* NetHack may be freely redistributed.  See license for details. */
  1519. X  
  1520. X! #ifdef MICROPORT_BUG
  1521. X  #define MKROOM_H
  1522. X  #endif
  1523. X  
  1524. X  #include "hack.h"
  1525. X  #include "mfndpos.h"
  1526. X- #ifdef NAMED_ITEMS
  1527. X- #  include "artifact.h"
  1528. X- #endif
  1529. X  
  1530. X  #ifdef WORM
  1531. X  #  include "wseg.h"
  1532. X--- 1,13 ----
  1533. X! /*    SCCS Id: @(#)mon.c    3.0    89/11/19
  1534. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1535. X  /* NetHack may be freely redistributed.  See license for details. */
  1536. X  
  1537. X! #if (defined(MICROPORT_BUG) || !defined(LINT)) && !defined(__STDC__)
  1538. X  #define MKROOM_H
  1539. X  #endif
  1540. X  
  1541. X  #include "hack.h"
  1542. X  #include "mfndpos.h"
  1543. X  
  1544. X  #ifdef WORM
  1545. X  #  include "wseg.h"
  1546. X***************
  1547. X*** 49,54 ****
  1548. X--- 46,52 ----
  1549. X          case PM_KOBOLD_ZOMBIE:
  1550. X          obj = mksobj_at(CORPSE, x, y);
  1551. X          obj->corpsenm = PM_KOBOLD;
  1552. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1553. X          break;
  1554. X          case PM_GNOME_MUMMY:
  1555. X          obj = mksobj_at(MUMMY_WRAPPING, x, y); /* and fall through */
  1556. X***************
  1557. X*** 55,60 ****
  1558. X--- 53,59 ----
  1559. X          case PM_GNOME_ZOMBIE:
  1560. X          obj = mksobj_at(CORPSE, x, y);
  1561. X          obj->corpsenm = PM_GNOME;
  1562. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1563. X          break;
  1564. X          case PM_ORC_MUMMY:
  1565. X          obj = mksobj_at(MUMMY_WRAPPING, x, y); /* and fall through */
  1566. X***************
  1567. X*** 61,66 ****
  1568. X--- 60,66 ----
  1569. X          case PM_ORC_ZOMBIE:
  1570. X          obj = mksobj_at(CORPSE, x, y);
  1571. X          obj->corpsenm = PM_ORC;
  1572. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1573. X          break;
  1574. X          case PM_ELF_MUMMY:
  1575. X          obj = mksobj_at(MUMMY_WRAPPING, x, y); /* and fall through */
  1576. X***************
  1577. X*** 67,72 ****
  1578. X--- 67,73 ----
  1579. X          case PM_ELF_ZOMBIE:
  1580. X          obj = mksobj_at(CORPSE, x, y);
  1581. X          obj->corpsenm = PM_ELF;
  1582. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1583. X          break;
  1584. X          case PM_HUMAN_MUMMY:
  1585. X          obj = mksobj_at(MUMMY_WRAPPING, x, y); /* and fall through */
  1586. X***************
  1587. X*** 73,78 ****
  1588. X--- 74,80 ----
  1589. X          case PM_HUMAN_ZOMBIE:
  1590. X          obj = mksobj_at(CORPSE, x, y);
  1591. X          obj->corpsenm = PM_HUMAN;
  1592. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1593. X          break;
  1594. X          case PM_GIANT_MUMMY:
  1595. X          obj = mksobj_at(MUMMY_WRAPPING, x, y); /* and fall through */
  1596. X***************
  1597. X*** 79,84 ****
  1598. X--- 81,87 ----
  1599. X          case PM_GIANT_ZOMBIE:
  1600. X          obj = mksobj_at(CORPSE, x, y);
  1601. X          obj->corpsenm = PM_GIANT;
  1602. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1603. X          break;
  1604. X          case PM_ETTIN_MUMMY:
  1605. X          obj = mksobj_at(MUMMY_WRAPPING, x, y); /* and fall through */
  1606. X***************
  1607. X*** 85,90 ****
  1608. X--- 88,94 ----
  1609. X          case PM_ETTIN_ZOMBIE:
  1610. X          obj = mksobj_at(CORPSE, x, y);
  1611. X          obj->corpsenm = PM_ETTIN;
  1612. X+         obj->age -= 50;            /* this is an *OLD* corpse */
  1613. X          break;
  1614. X  #ifdef GOLEMS
  1615. X          case PM_IRON_GOLEM:
  1616. X***************
  1617. X*** 173,179 ****
  1618. X          mtmp->mlstmv = moves;
  1619. X  
  1620. X          /* most monsters drown in pools */
  1621. X!         { boolean inpool,infountain,iseel,isgremlin;
  1622. X  
  1623. X            inpool = is_pool(mtmp->mx,mtmp->my);
  1624. X            iseel = mtmp->data->mlet == S_EEL;
  1625. X--- 177,186 ----
  1626. X          mtmp->mlstmv = moves;
  1627. X  
  1628. X          /* most monsters drown in pools */
  1629. X!         { boolean inpool,iseel,isgremlin;
  1630. X! #ifdef FOUNTAINS
  1631. X!           boolean infountain;
  1632. X! #endif
  1633. X  
  1634. X            inpool = is_pool(mtmp->mx,mtmp->my);
  1635. X            iseel = mtmp->data->mlet == S_EEL;
  1636. X***************
  1637. X*** 226,232 ****
  1638. X          if(mtmp->mspeed != MSLOW || !(moves%2)){
  1639. X              /* continue if the monster died fighting */
  1640. X              fr = -1;
  1641. X! /* TODO:    Handle the case of the agressor dying? */
  1642. X              if(Conflict && !mtmp->iswiz &&
  1643. X                 /* area you can see if you're not blind */
  1644. X                 (dist(mtmp->mx,mtmp->my) < 3 ||
  1645. X--- 233,239 ----
  1646. X          if(mtmp->mspeed != MSLOW || !(moves%2)){
  1647. X              /* continue if the monster died fighting */
  1648. X              fr = -1;
  1649. X! /* TODO:    Handle the case of the aggressor dying? */
  1650. X              if(Conflict && !mtmp->iswiz &&
  1651. X                 /* area you can see if you're not blind */
  1652. X                 (dist(mtmp->mx,mtmp->my) < 3 ||
  1653. X***************
  1654. X*** 300,308 ****
  1655. X          newsym(mtmp->mx, mtmp->my);
  1656. X      }
  1657. X      /* Eats topmost metal object if it is there */
  1658. X!     for (otmp = fobj; otmp; otmp = otmp->nobj)
  1659. X!         if (otmp->ox == mtmp->mx && otmp->oy == mtmp->my &&
  1660. X!         objects[otmp->otyp].oc_material > WOOD &&
  1661. X          objects[otmp->otyp].oc_material < MINERAL) {
  1662. X              if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1663. X              pline("%s eats %s!", Monnam(mtmp),
  1664. X--- 307,315 ----
  1665. X          newsym(mtmp->mx, mtmp->my);
  1666. X      }
  1667. X      /* Eats topmost metal object if it is there */
  1668. X!     for (otmp = level.objects[mtmp->mx][mtmp->my];
  1669. X!                             otmp; otmp = otmp->nexthere)
  1670. X!         if (objects[otmp->otyp].oc_material > WOOD &&
  1671. X          objects[otmp->otyp].oc_material < MINERAL) {
  1672. X              if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1673. X              pline("%s eats %s!", Monnam(mtmp),
  1674. X***************
  1675. X*** 337,365 ****
  1676. X  
  1677. X      /* Eats organic, glass, or wood objects if there */
  1678. X      /* Engulfs others, except huge rocks and metal attached to player */
  1679. X!     for (otmp = fobj; otmp; otmp = otmp2) {
  1680. X!         otmp2 = otmp->nobj;
  1681. X!         if (otmp->ox == mtmp->mx && otmp->oy == mtmp->my) {
  1682. X!         if(objects[otmp->otyp].oc_material <= WOOD) {
  1683. X!             if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1684. X!             pline("%s eats %s!", Monnam(mtmp),
  1685. X!                 distant_name(otmp, doname));
  1686. X!             else if (flags.soundok && flags.verbose)
  1687. X!             You("hear a slurping sound.");
  1688. X!                     /* Heal up to the object's weight in hp */
  1689. X!             if (mtmp->mhp < mtmp->mhpmax) {
  1690. X!             mtmp->mhp += objects[otmp->otyp].oc_weight;
  1691. X!             if (mtmp->mhp > mtmp->mhpmax) mtmp->mhp = mtmp->mhpmax;
  1692. X!             }
  1693. X!             delobj(otmp);        /* munch */
  1694. X!         } else if (otmp->olet != ROCK_SYM &&
  1695. X!                     otmp != uball && otmp != uchain) {
  1696. X!             if (cansee(mtmp->mx, mtmp->my) && flags.verbose)
  1697. X!             pline("%s engulfs %s.", Monnam(mtmp),
  1698. X!                 distant_name(otmp,doname));
  1699. X!             freeobj(otmp);
  1700. X!             mpickobj(mtmp, otmp);    /* slurp */
  1701. X          }
  1702. X          }
  1703. X          /* Engulf & devour is instant, so don't set meating */
  1704. X          newsym(mtmp->mx, mtmp->my);
  1705. X--- 344,370 ----
  1706. X  
  1707. X      /* Eats organic, glass, or wood objects if there */
  1708. X      /* Engulfs others, except huge rocks and metal attached to player */
  1709. X!     for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp2) {
  1710. X!         otmp2 = otmp->nexthere;
  1711. X!         if(objects[otmp->otyp].oc_material <= WOOD) {
  1712. X!         if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1713. X!             pline("%s eats %s!", Monnam(mtmp),
  1714. X!                 distant_name(otmp, doname));
  1715. X!         else if (flags.soundok && flags.verbose)
  1716. X!             You("hear a slurping sound.");
  1717. X!         /* Heal up to the object's weight in hp */
  1718. X!         if (mtmp->mhp < mtmp->mhpmax) {
  1719. X!             mtmp->mhp += objects[otmp->otyp].oc_weight;
  1720. X!             if (mtmp->mhp > mtmp->mhpmax) mtmp->mhp = mtmp->mhpmax;
  1721. X          }
  1722. X+         delobj(otmp);        /* munch */
  1723. X+         } else if (otmp->olet != ROCK_SYM &&
  1724. X+                     otmp != uball && otmp != uchain) {
  1725. X+         if (cansee(mtmp->mx, mtmp->my) && flags.verbose)
  1726. X+             pline("%s engulfs %s.", Monnam(mtmp),
  1727. X+                 distant_name(otmp,doname));
  1728. X+         freeobj(otmp);
  1729. X+         mpickobj(mtmp, otmp);    /* slurp */
  1730. X          }
  1731. X          /* Engulf & devour is instant, so don't set meating */
  1732. X          newsym(mtmp->mx, mtmp->my);
  1733. X***************
  1734. X*** 389,408 ****
  1735. X  {
  1736. X      register struct obj *otmp;
  1737. X  
  1738. X!     for(otmp = fobj; otmp; otmp = otmp->nobj)
  1739. X!       if(throws_rocks(mtmp->data) ? otmp->otyp == BOULDER :
  1740. X              (otmp->olet == GEM_SYM && otmp->otyp < LAST_GEM+6))
  1741. X!         if(otmp->ox == mtmp->mx && otmp->oy == mtmp->my)
  1742. X!           if(mtmp->data->mlet != S_UNICORN
  1743. X!          || objects[otmp->otyp].g_val != 0){
  1744. X!         if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1745. X              pline("%s picks up %s.", Monnam(mtmp),
  1746. X                  distant_name(otmp, doname));
  1747. X!         freeobj(otmp);
  1748. X!         mpickobj(mtmp, otmp);
  1749. X!         newsym(mtmp->mx, mtmp->my);
  1750. X!         return;    /* pick only one object */
  1751. X!           }
  1752. X  }
  1753. X  
  1754. X  int
  1755. X--- 394,412 ----
  1756. X  {
  1757. X      register struct obj *otmp;
  1758. X  
  1759. X!     for(otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp=otmp->nexthere)
  1760. X!         if(throws_rocks(mtmp->data) ? otmp->otyp == BOULDER :
  1761. X              (otmp->olet == GEM_SYM && otmp->otyp < LAST_GEM+6))
  1762. X!         if(mtmp->data->mlet != S_UNICORN
  1763. X!             || objects[otmp->otyp].g_val != 0){
  1764. X!             if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1765. X              pline("%s picks up %s.", Monnam(mtmp),
  1766. X                  distant_name(otmp, doname));
  1767. X!             freeobj(otmp);
  1768. X!             mpickobj(mtmp, otmp);
  1769. X!             newsym(mtmp->mx, mtmp->my);
  1770. X!             return;    /* pick only one object */
  1771. X!         }
  1772. X  }
  1773. X  
  1774. X  int
  1775. X***************
  1776. X*** 481,489 ****
  1777. X  /*    prevent shopkeepers from leaving the door of their shop */
  1778. X      if(mtmp->isshk && inhishop(mtmp)) return;
  1779. X  
  1780. X!     for(otmp = fobj; otmp; otmp = otmp->nobj)
  1781. X!       if(index(str, otmp->olet))
  1782. X!         if(otmp->ox == mtmp->mx && otmp->oy == mtmp->my) {
  1783. X          if(!can_carry(mtmp,otmp)) return;
  1784. X          if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1785. X              pline("%s picks up %s.", Monnam(mtmp), doname(otmp));
  1786. X--- 485,492 ----
  1787. X  /*    prevent shopkeepers from leaving the door of their shop */
  1788. X      if(mtmp->isshk && inhishop(mtmp)) return;
  1789. X  
  1790. X!     for(otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp=otmp->nexthere)
  1791. X!         if(index(str, otmp->olet)) {
  1792. X          if(!can_carry(mtmp,otmp)) return;
  1793. X          if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1794. X              pline("%s picks up %s.", Monnam(mtmp), doname(otmp));
  1795. X***************
  1796. X*** 503,516 ****
  1797. X      long *info;    /* long info[9] */
  1798. X      long flag;
  1799. X  {
  1800. X!     register int x,y,nx,ny,cnt = 0,ntyp;
  1801. X!     int nowtyp;
  1802. X!     boolean wantpool,poolok;
  1803. X  
  1804. X      x = mon->mx;
  1805. X      y = mon->my;
  1806. X      nowtyp = levl[x][y].typ;
  1807. X  
  1808. X      wantpool = mon->data->mlet == S_EEL;
  1809. X      poolok = is_flyer(mon->data) || (is_swimmer(mon->data) && !wantpool);
  1810. X  nexttry:    /* eels prefer the water, but if there is no water nearby,
  1811. X--- 506,521 ----
  1812. X      long *info;    /* long info[9] */
  1813. X      long flag;
  1814. X  {
  1815. X!     register int x,y,nx,ny,cnt = 0;
  1816. X!     register uchar ntyp;
  1817. X!     uchar nowtyp;
  1818. X!     boolean wantpool,poolok,nodiag;
  1819. X  
  1820. X      x = mon->mx;
  1821. X      y = mon->my;
  1822. X      nowtyp = levl[x][y].typ;
  1823. X  
  1824. X+     nodiag = (mon->data == &mons[PM_GRID_BUG]);
  1825. X      wantpool = mon->data->mlet == S_EEL;
  1826. X      poolok = is_flyer(mon->data) || (is_swimmer(mon->data) && !wantpool);
  1827. X  nexttry:    /* eels prefer the water, but if there is no water nearby,
  1828. X***************
  1829. X*** 523,528 ****
  1830. X--- 528,534 ----
  1831. X          flag |= ALLOW_SSM;
  1832. X      for(nx = x-1; nx <= x+1; nx++) for(ny = y-1; ny <= y+1; ny++) {
  1833. X          if((nx == x && ny == y) || !isok(nx,ny)) continue;
  1834. X+         if(nx != x && ny != y && nodiag) continue;
  1835. X          if(IS_ROCK(ntyp = levl[nx][ny].typ) && !(flag & ALLOW_WALL) &&
  1836. X          !((flag & ALLOW_DIG) && may_dig(nx,ny))) continue;
  1837. X          if(IS_DOOR(ntyp) && !amorphous(mon->data) &&
  1838. X***************
  1839. X*** 532,538 ****
  1840. X             (verysmall(mon->data) ||
  1841. X              (!is_giant(mon->data) && nohands(mon->data))))
  1842. X             ) && !(flag & (ALLOW_WALL|ALLOW_DIG))) continue;
  1843. X!         if(nx != x && ny != y && (IS_DOOR(nowtyp) || IS_DOOR(ntyp)))
  1844. X          continue;
  1845. X          if(is_pool(nx,ny) == wantpool || poolok) {
  1846. X          /* Displacement also displaces the Elbereth/scare monster,
  1847. X--- 538,553 ----
  1848. X             (verysmall(mon->data) ||
  1849. X              (!is_giant(mon->data) && nohands(mon->data))))
  1850. X             ) && !(flag & (ALLOW_WALL|ALLOW_DIG))) continue;
  1851. X!         if(nx != x && ny != y &&
  1852. X! #ifdef REINCARNATION
  1853. X!            ((IS_DOOR(nowtyp) && ((levl[x][y].doormask & ~D_BROKEN)
  1854. X!             || dlevel == rogue_level)) ||
  1855. X!         (IS_DOOR(ntyp) && ((levl[nx][ny].doormask & ~D_BROKEN)
  1856. X!             || dlevel == rogue_level))))
  1857. X! #else
  1858. X!            ((IS_DOOR(nowtyp) && (levl[x][y].doormask & ~D_BROKEN)) ||
  1859. X!         (IS_DOOR(ntyp) && (levl[nx][ny].doormask & ~D_BROKEN))))
  1860. X! #endif
  1861. X          continue;
  1862. X          if(is_pool(nx,ny) == wantpool || poolok) {
  1863. X          /* Displacement also displaces the Elbereth/scare monster,
  1864. X***************
  1865. X*** 629,634 ****
  1866. X--- 644,660 ----
  1867. X      return dx*dx + dy*dy;
  1868. X  }
  1869. X  
  1870. X+ boolean
  1871. X+ monnear(mon, x, y)
  1872. X+ register struct monst *mon;
  1873. X+ register int x,y;
  1874. X+ /* Is the square close enough for the monster to move or attack into? */
  1875. X+ {
  1876. X+     register int distance = dist2(mon->mx, mon->my, x, y);
  1877. X+     if (distance==2 && mon->data==&mons[PM_GRID_BUG]) return 0;
  1878. X+     return (distance < 3);
  1879. X+ }
  1880. X+ 
  1881. X  static const char *poiseff[] = {
  1882. X  
  1883. X      " feel very weak", "r brain is on fire",
  1884. X***************
  1885. X*** 659,665 ****
  1886. X          plural = (string[strlen(string) - 1] == 's')? 1 : 0;
  1887. X          if(Blind)
  1888. X          pline("%s poisoned.", plural ? "They were" : "It was");
  1889. X! #ifdef HARD
  1890. X          /* avoid "The" Orcus's sting was poisoned... */
  1891. X          else if(isupper(*string))
  1892. X          pline("%s %s poisoned!", string, plural ? "were" : "was");
  1893. X--- 685,691 ----
  1894. X          plural = (string[strlen(string) - 1] == 's')? 1 : 0;
  1895. X          if(Blind)
  1896. X          pline("%s poisoned.", plural ? "They were" : "It was");
  1897. X! #ifdef INFERNO
  1898. X          /* avoid "The" Orcus's sting was poisoned... */
  1899. X          else if(isupper(*string))
  1900. X          pline("%s %s poisoned!", string, plural ? "were" : "was");
  1901. X***************
  1902. X*** 930,935 ****
  1903. X--- 956,966 ----
  1904. X          newsym(x,y);
  1905. X      }
  1906. X  #endif
  1907. X+     if(mdat->mlet == S_UNICORN) {
  1908. X+         (void) mksobj_at(UNICORN_HORN, x, y);
  1909. X+         stackobj(fobj);
  1910. X+         newsym(x,y);
  1911. X+     }
  1912. X  #ifdef MAIL
  1913. X      if(mdat == &mons[PM_MAIL_DAEMON]) {
  1914. X          (void) mksobj_at(SCR_MAIL, x, y);
  1915. X***************
  1916. X*** 954,960 ****
  1917. X              otmp = mkobj_at(RANDOM_SYM, x, y);
  1918. X              /* Don't create large objects from small monsters */
  1919. X              typ = otmp->otyp;
  1920. X!             if (!bigmonst(mdat) && typ != FOOD_RATION
  1921. X  #ifdef WALKIES
  1922. X                  && typ != LEASH
  1923. X  #endif
  1924. X--- 985,991 ----
  1925. X              otmp = mkobj_at(RANDOM_SYM, x, y);
  1926. X              /* Don't create large objects from small monsters */
  1927. X              typ = otmp->otyp;
  1928. X!             if (mdat->msize < MZ_HUMAN && typ != FOOD_RATION
  1929. X  #ifdef WALKIES
  1930. X                  && typ != LEASH
  1931. X  #endif
  1932. X***************
  1933. X*** 973,979 ****
  1934. X           * different from whether or not the corpse is "special";
  1935. X           * if we want both, we have to specify it explicitly.
  1936. X           */
  1937. X!         if (bigmonst(mdat)
  1938. X  #ifdef GOLEMS
  1939. X                     || is_golem(mdat)
  1940. X  #endif
  1941. X--- 1004,1010 ----
  1942. X           * different from whether or not the corpse is "special";
  1943. X           * if we want both, we have to specify it explicitly.
  1944. X           */
  1945. X!         if (bigmonst(mdat) || mdat == &mons[PM_LIZARD]
  1946. X  #ifdef GOLEMS
  1947. X                     || is_golem(mdat)
  1948. X  #endif
  1949. X***************
  1950. X*** 1007,1013 ****
  1951. X      register struct monst *mtmp;
  1952. X  
  1953. X      for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1954. X!         if (mtmp->data->mlet == S_CHAMELEON)
  1955. X              mtmp->cham = 1;
  1956. X  }
  1957. X  
  1958. X--- 1038,1044 ----
  1959. X      register struct monst *mtmp;
  1960. X  
  1961. X      for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1962. X!         if (mtmp->data == &mons[PM_CHAMELEON])
  1963. X              mtmp->cham = 1;
  1964. X  }
  1965. X  
  1966. X***************
  1967. X*** 1045,1055 ****
  1968. X  #ifdef WORM
  1969. X      if(mtmp->wormno) wormdead(mtmp);    /* throw tail away */
  1970. X  #endif
  1971. X-     mtmp->m_lev = adj_lev(mdat);        /* new monster level */
  1972. X- 
  1973. X      hpn = mtmp->mhp;
  1974. X       hpd = (mtmp->m_lev < 50) ? (mtmp->m_lev)*8 : mdat->mlevel;
  1975. X       if(!hpd) hpd = 4;
  1976. X       mhp = (mtmp->m_lev < 50) ? (mtmp->m_lev)*8 : mdat->mlevel;
  1977. X       if(!mhp) mhp = 4;
  1978. X  
  1979. X--- 1076,1087 ----
  1980. X  #ifdef WORM
  1981. X      if(mtmp->wormno) wormdead(mtmp);    /* throw tail away */
  1982. X  #endif
  1983. X      hpn = mtmp->mhp;
  1984. X       hpd = (mtmp->m_lev < 50) ? (mtmp->m_lev)*8 : mdat->mlevel;
  1985. X       if(!hpd) hpd = 4;
  1986. X+ 
  1987. X+     mtmp->m_lev = adj_lev(mdat);        /* new monster level */
  1988. X+ 
  1989. X       mhp = (mtmp->m_lev < 50) ? (mtmp->m_lev)*8 : mdat->mlevel;
  1990. X       if(!mhp) mhp = 4;
  1991. X  
  1992. X***************
  1993. X*** 1244,1250 ****
  1994. X  {
  1995. X      struct obj *otmp;
  1996. X  
  1997. X!     if(!verysmall(mdef->data) ||
  1998. X         !rn2(2 + ((mdef->data->geno & G_FREQ) > 2))) {
  1999. X          otmp = mk_named_object(STATUE, mdef->data, mdef->mx, mdef->my,
  2000. X              NAME(mdef), (int)mdef->mnamelth);
  2001. X--- 1276,1282 ----
  2002. X  {
  2003. X      struct obj *otmp;
  2004. X  
  2005. X!     if(mdef->data->msize > MZ_TINY ||
  2006. X         !rn2(2 + ((mdef->data->geno & G_FREQ) > 2))) {
  2007. X          otmp = mk_named_object(STATUE, mdef->data, mdef->mx, mdef->my,
  2008. X              NAME(mdef), (int)mdef->mnamelth);
  2009. END_OF_FILE
  2010. if test 54198 -ne `wc -c <'patches06h'`; then
  2011.     echo shar: \"'patches06h'\" unpacked with wrong size!
  2012. fi
  2013. # end of 'patches06h'
  2014. fi
  2015. echo shar: End of archive 7 \(of 15\).
  2016. cp /dev/null ark7isdone
  2017. MISSING=""
  2018. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  2019.     if test ! -f ark${I}isdone ; then
  2020.     MISSING="${MISSING} ${I}"
  2021.     fi
  2022. done
  2023. if test "${MISSING}" = "" ; then
  2024.     echo You have unpacked all 15 archives.
  2025.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2026. else
  2027.     echo You still need to unpack the following archives:
  2028.     echo "        " ${MISSING}
  2029. fi
  2030. ##  End of shell archive.
  2031. exit 0
  2032.